﻿using System;
using System.Collections.Generic;
using MovieDB.Common;
using MovieDB.FactoryInterfaces;
using MovieDB.Models;

namespace MovieDB.Factories
{
    public class ModelFactory : IModelFactory
    {
        #region IModelFactory Members

        public MovieModel CreateMovieModel(ModelCRUDType type)
        {
            return new MovieModel
                   {
                       Id = Guid.NewGuid(),
                       Type = type,
                       VideoQuality = new VideoQualityModel
                                      {
                                          VideoType = VideoType.HD,
                                          VideoResolution = VideoResolution.TenEigthyP
                                      },
                       AudioQualities = new List<AudioQualityModel>
                                        {
                                            new AudioQualityModel
                                            {
                                                AudioType = AudioType.DolbyDigital,
                                                AudioChannels = AudioChannels.FiveDotOne
                                            }
                                        }
                   };
        }

        public PagedMovieModel CreatePagedMovieModel(IEnumerable<MovieModel> movies, string nextPageUrl, int page, int pageSize, int totalAmountOfMovies)
        {
            return new PagedMovieModel { Movies = movies, NextPageBaseUrl = nextPageUrl, Page = page, PageSize = pageSize, TotalAmountOfMovies = totalAmountOfMovies };
        }

        #endregion
    }
}